# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig do
  @moduledoc """
  The identity to configure a GCS bucket.

  ## Attributes

  *   `admins` (*type:* `list(String.t)`, *default:* `nil`) - 
  *   `bucketName` (*type:* `String.t`, *default:* `nil`) - Input/Output [Optional]. The name of a GCS bucket with max length of 63 chars. If not set, a random UUID will be generated as bucket name.
  *   `entityName` (*type:* `String.t`, *default:* `nil`) - Input/Output [Optional]. Only needed for per-entity tenant GCP resources. During Deprovision API, the on-demand deletion will only cover the tenant GCP resources with the specified entity name.
  *   `kmsKeyReference` (*type:* `String.t`, *default:* `nil`) - Input/Output [Optional]. The KMS key name or the KMS grant name used for CMEK encryption. Only set this field when provisioning new GCS bucket. For existing GCS bucket, this field will be ignored because CMEK re-encryption is not supported.
  *   `ttlDays` (*type:* `integer()`, *default:* `nil`) - Input/Output [Optional]. Only needed when the content in bucket need to be garbage collected within some amount of days.
  *   `viewers` (*type:* `list(String.t)`, *default:* `nil`) - Input/Output [Required]. IAM roles (viewer/admin) put on the bucket.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :admins => list(String.t()) | nil,
          :bucketName => String.t() | nil,
          :entityName => String.t() | nil,
          :kmsKeyReference => String.t() | nil,
          :ttlDays => integer() | nil,
          :viewers => list(String.t()) | nil
        }

  field(:admins, type: :list)
  field(:bucketName)
  field(:entityName)
  field(:kmsKeyReference)
  field(:ttlDays)
  field(:viewers, type: :list)
end

defimpl Poison.Decoder,
  for: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ContentWarehouse.V1.Model.CloudAiPlatformTenantresourceGcsBucketConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
